<!--
 * @FilePath: index.vue
 * @Author: 杜芬
 * @Date: 2021-11-12 20:07:43
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-12-04 09:07:20
 * Copyright: 2023 xxxTech CO.,LTD. All Rights Reserved.
 * @Descripttion: 页面
-->
<template>
  <div class="tag-table">
    <div class="box">
      <el-table :data="tableData" stripe class="table">
        <el-table-column type="index" label="序号" />
        <el-table-column prop="date" label="日期" />
        <el-table-column prop="date" label="日期">
          <template slot-scope="scope">
            <!-- 折叠面板 -->
            <el-collapse v-model="activeNames">
              <el-collapse-item title="...">
                <div v-for="(item, i) in scope.row.list" :key="i">{{ item.name }}</div>
              </el-collapse-item>
            </el-collapse>
          </template>
        </el-table-column>
        <el-table-column prop="date" label="日期" />
        <el-table-column prop="Nname" label="客户">
          <template slot-scope="scope">
            <a @click="onClick(scope.row)">{{ scope.row.Nname }}</a>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="姓名" />
        <el-table-column prop="address" label="地址" />
      </el-table>
      <!-- 折叠面板 -->
      <el-collapse v-model="activeNames" @change="handleChange">
        <el-collapse-item title="折叠面板...">
          <div v-for="(item, i) in list" :key="i">{{ item.name }}</div>
        </el-collapse-item>
      </el-collapse>
    </div>
    <!--  -->
    <addForm-Dialog :dialog-visible="dialogVisible" @uptate="uptate" />
  </div>
</template>
<script>
import addFormDialog from '@/views/tagTable/components/addFormDialog.vue';
export default {
  name: 'TagTable',
  components: {
    addFormDialog,
  },
  data() {
    return {
      dialogVisible: false,
      activeNames: [],
      list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
      tableData: [
        {
          date: '2016-05-02',
          Nname: '客户1',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          Nname: '客户1',
          address: '上海市普陀区金沙江路 1517 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          Nname: '客户1',
          address: '上海市普陀区金沙江路 1517 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          Nname: '客户1',
          address: '上海市普陀区金沙江路 1517 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          Nname: '客户1',
          address: '上海市普陀区金沙江路 1517 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          Nname: '客户1',
          address: '上海市普陀区金沙江路 1517 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          Nname: '客户1',
          address: '上海市普陀区金沙江路 1517 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          Nname: '客户1',
          address: '上海市普陀区金沙江路 1517 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          Nname: '客户1',
          address: '上海市普陀区金沙江路 1517 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          Nname: '客户1',
          address: '上海市普陀区金沙江路 1517 弄',
          list: [{ name: '4561' }, { name: '4561' }, { name: '4561' }, { name: '4561' }],
        },
      ],
    };
  },
  methods: {
    // 折叠面板
    handleChange(val) {
      console.log(val);
    },
    onClick(val) {
      // console.log(val);
      // console.log('ok');
      this.dialogVisible = true;
    },
    uptate() {
      this.dialogVisible = false;
    },
  },
};
</script>
<style lang="scss" scoped>
.tag-Table {
  width: 100%;
  height: calc(100vh - 50px);
  background-color: #007acc;
  .el-collapse {
    margin-top: 15px;
  }
  // 表格
}
::v-deep {
  .table {
    width: 100%;
    height: 100%;
    background-color: #007acc;
  }
}
</style>
